<template>
  <view class='section list'>
    <view class="item cont" v-for="(it, k) in lists" :key="k">
      <view :data-type="it.is_video" class="clearfloat" @click="goDetail(it.id)">
        <image :src="it.imgs" mode='widthFix' lazy-load="true" @error="imgError(k, 'p')"></image>
        <text class="title">{{it.title}}</text>
      </view>
      <image src='../../static/9.png' class="isvideo" v-if="it.is_video == 1"></image>
      <view class='col-12 author'>
        <view class="col-6 icon-txt" :data-storeid="it.mechanism_id" @click="seeDetail">
          <image :src="it.logo" mode='widthFix' lazy-load="true" @error="imgError(k, 'a')" class="col-3 icon" v-if="it.logo"></image><image src="../../static/avatars_default.png" mode='widthFix' class="col-3 icon" v-else></image><text class="col-9 txt">{{it.name}}</text>
		  <image src="../../static/4.png" lazy-load="true" class="vip" v-if="it.grade == 1"></image>
		  <image src="../../static/51.png" lazy-load="true" class="vip" v-if="it.grade == 2"></image>
		</view>
        <view class="col-6 icon-txt" style='text-align: right;' :data-zxid="it.id" @click="setLike">
          <image src="../../static/12.png" mode='widthFix' lazy-load="true" class="col-3 icon r"></image><text class="txt">{{it.distance}}</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
	export default {
		name: 'pictxt-nearby',
		props: ['lists'],
		data() {
			return {
				
			}
		},
		methods: {
			// 图片加载
			imgError(i, t) {
				let tmpLists = this.lists;
				if(t === 'p') {
					tmpLists[i].imgs = '../../static/default.jpg';
				}else if (t === 'a') {
					tmpLists[i].logo = '../../static/avatars_default.png';
				}
				this.lists = tmpLists;
			},
		}
	}
</script>

<style>
	.author .icon-txt .txt {font-size: 26upx;}
	.author .icon-txt .icon.r {width: 28upx;}
</style>
